package com.huawei123.hasee.cniao5store.di.module;

import android.app.Activity;
import android.content.Context;

import com.huawei123.hasee.cniao5store.di.scope.ContextLife;
import com.huawei123.hasee.cniao5store.di.scope.PerActivity;

import dagger.Module;
import dagger.Provides;

/**
 * 项目名称：Cniao5Store
 * 类描述：提供Activity绑定
 * 创建人：Administrator
 * 创建时间：2017/11/6 0006 上午 10:54
 * 修改人：Administrator
 * 修改时间：2017/11/6 0006 上午 10:54
 * 修改备注：
 */
@Module
public class ActivityModule {
    private Activity myActivity;

    public ActivityModule(Activity myActivity) {
        this.myActivity = myActivity;
    }

    @Provides
    @PerActivity
    public Activity providesActivity() {
        return myActivity;
    }

    @Provides
    @PerActivity
    @ContextLife("Activity")
    public Context providesActivityContext() {
        return myActivity;
    }
}
